package com.xiaoqing.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;


import com.xiaoqing.response.Result;
import com.xiaoqing.response.ResultCode;

import org.apache.catalina.User;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.jws.soap.SOAPBinding;
import java.lang.invoke.LambdaMetafactory;

@RestController
@RequestMapping(value = "/api")

public class UserController {
    /**
     * 注册之前要确认用户是否已经存在
     */
    @GetMapping("/ckusr")
    public Result checkUsre(String username){
        if (StringUtils.isEmpty(username)){
            return Result.error(ResultCode.PARAM_IS_BLANK);
        }
        //判断用户如果没有报错
        LambdaQueryWrapper<User>queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.eq(User::getUsername,username);
        return null;
    }
}

